package edu.study.ops.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;

/**
 * java constant
 */
@RefreshScope
@Service
@Getter
@Setter
public class OpsConstant {

	@Value("${swagger2.enable}")
	private boolean swagger2Enable;

	@Value("${spring.application.name}")
	private String prefix;
    
	@Value("${ops.max.inactive.interval}")
	private Integer OPS_MAX_INACTIVE_INTERVAL = 60 * 15;//平台登录 token 失效时间设置为 15min
	
	@Value("${ops.validate.white.list}")
	private String whiteList;

	@Value("${ops.validate.black.list}")
	private String blackList;

	@Value("${ops.admin.loginName}")
	private String adminLoginName;
		
	@Value("${oss.accessId}")
    private String ossAccessId;

    @Value("${oss.accessKey}")
    private String ossAccessKey;

    @Value("${oss.endpoint}")
    private String ossEndpoint;

    @Value("${oss.bucketName}")
    private String ossBucketName;

    @Value("https://"+"${oss.bucketName}"+"."+"${oss.endpoint}"+"/")
    private String ossUrlPrefix;

    @Value("${upload.file.size}")
	private int uploadFileSize;
    
    @Value("${ops.login.only}")
	private Boolean opsLoginOnly;
}
